const APIV1 = '/api/v1'

// 配合 antpage + nginx 代理，后台 antpage.servlet-path=antpage
const ANTPAGE = '/antpage'
// const ANTPAGE = ''
// const ANTPAGE = 'http://127.0.0.1:9998'
// 是否开启 mock
const ISMOCK = false

module.exports = {
  // 页面标签
  pageTitle: '门户配置',
  // 登录页form框上部显示标题
  name: 'Ant-UC',
  // 全局前缀，用于自定义特定变量
  prefix: 'antuc',
  // 全局token
  globalToken: 'antuc_token',
  // 全局页脚信息
  footerText: '门户配置  © 2018 PTP',
  // logo 路径
  logo: '/public/logo.svg',
  // 字体文件路径
  iconFontCSS: '/public/iconfont.css',
  iconFontJS: '/public/iconfont.js',
  // 网络安全配置ant-uc
  CORS: [],
  YQL: [],
  // TODO ?? 开启的页面路径
  openPages: ['/login'],
  // api 请求前缀
  // apiPrefix: '/api/v1',
  apiPrefix: '/api/v1',
  APIV1,
  ANTPAGE,
  ISMOCK,
  api: {
    // 登录
    userLogin: ISMOCK ? `${APIV1}/user/login` : `${ANTPAGE}/antuc/login`,
    // 登出
    userLogout: `${APIV1}/user/logout`,
    // 查询用户
    users: `${APIV1}/users`,
    user: ISMOCK ? `${APIV1}/user/:id` : `${ANTPAGE}/antuc/user`,
    // TODO 请求菜单
    // menus: `${APIV1}/menus`,
    // 布局管理器
    layoutManager: `${ANTPAGE}/layout/manager`,

    dashboard: `${APIV1}/dashboard`,
    userInfo: `${APIV1}/userInfo`,
    posts: `${APIV1}/posts`,
    weather: `${APIV1}/weather`,
    v1test: `${APIV1}/test`,

    menus: `${ANTPAGE}/antuc/menus`,
    // portlet
    portlet: {
      findPortletToPubUrl: `${ANTPAGE}/portlet/findPortletToPub`,
    },
    // role
    role: {
      findAllRoleUrl: `${ANTPAGE}/role/findAllRole`,
    },
    // region
    region: {
      findAllRegionUrl: `${ANTPAGE}/region/findAllRegion`,
    },
    // 文件上传
    upload: {
      uploadFile: `${ANTPAGE}/upload/uploadFile`,
    },
    // 内容管理
    content: {
      // 文章管理
      article: {
        // 全部文章操作
        findAllArticleUrl: `${ANTPAGE}/content/article/findAllArticle`,
        insertArticleUrl: `${ANTPAGE}/content/article/insertArticle`,
        removeArticleUrl: `${ANTPAGE}/content/article/removeArticle`,
        removesArticleUrl: `${ANTPAGE}/content/article/removesArticle`,
        updateArticleUrl: `${ANTPAGE}/content/article/updateArticle`,
        // 已发布文章操作
        findAllPubArticleUrl: `${ANTPAGE}/content/article/findAllPubArticle`,
        insertArticlePubUrl: `${ANTPAGE}/content/article/insertPubArticle`,
        removeArticlePubUrl: `${ANTPAGE}/content/article/removePubArticle`,
        removesArticlePubUrl: `${ANTPAGE}/content/article/removesPubArticle`,
        updateArticlePubUrl: `${ANTPAGE}/content/article/updatePubArticle`,
        // 获取发布位置
        findPortletToPubUrl: `${ANTPAGE}/content/article/getPubTarget`,
      },
      // 链接管理
      link: {
        // 全部链接操作
        findAllLinkUrl: `${ANTPAGE}/content/link/findAllLink`,
        insertLinkUrl: `${ANTPAGE}/content/link/insertLink`,
        removeLinkUrl: `${ANTPAGE}/content/link/removeLink`,
        removesLinkUrl: `${ANTPAGE}/content/link/removesLink`,
        updateLinkUrl: `${ANTPAGE}/content/link/updateLink`,
        // 已发布链接操作
        findAllPubLinkUrl: `${ANTPAGE}/content/link/findAllPubLink`,
        // insertLinkPubUrl: `${ANTPAGE}/content/link/insertPubLink`,
        insertPubLinkRoleUrl: `${ANTPAGE}/content/link/insertPubLinkRole`,
        insertPubLinkComUrl: `${ANTPAGE}/content/link/insertPubLinkCom`,

        // removeLinkPubUrl: `${ANTPAGE}/content/link/removePubLink`,
        removePubLinkRoleUrl: `${ANTPAGE}/content/link/removePubLinkRole`,
        removePubLinkComUrl: `${ANTPAGE}/content/link/removePubLinkCom`,

        removesLinkPubUrl: `${ANTPAGE}/content/link/removesPubLink`,
        updateLinkPubUrl: `${ANTPAGE}/content/link/updatePubLink`,
        // 获取发布位置
        getPgPletIdUrl: `${ANTPAGE}/content/link/getPgPletId`,
      },
    },

  },
}
